Namespace Controls

    <Serializable(), ObfuscationAttribute(Exclude:=True, ApplyToMembers:=True)> _
    Public Class GraphContainerSetting
        Implements IComparable(Of GraphContainerSetting), IComparable

        Private mName As String = ""
        Private mColour As Color = Color.Black
        Private mBoundPane As String = ""

        Sub New(ByVal Name As String, ByVal Colour As Color, ByVal BoundPane As String)
            If Name = "" Then
                Throw New ArgumentException("Name cannot be a NULL string")
            End If
            mName = Name
            mColour = Colour
            mBoundPane = BoundPane
        End Sub

        ''' <summary>
        ''' Name of the graph setting. Usualy the name of the graph item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Name() As String
            Get
                Return mName
            End Get
        End Property

        ''' <summary>
        ''' Colour to use to display in the graph
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Colour() As Color
            Get
                Return mColour
            End Get
            Set(ByVal value As Color)
                mColour = value
            End Set
        End Property

        ''' <summary>
        ''' Graph pane to send item to
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property BoundPane() As String
            Get
                Return mBoundPane
            End Get
            Set(ByVal value As String)
                mBoundPane = value
            End Set
        End Property

        Public Function CompareTo(ByVal other As GraphContainerSetting) As Integer Implements System.IComparable(Of GraphContainerSetting).CompareTo
            If Not (Me.BoundPane = "" Xor other.BoundPane = "") Then
                If Me.Name > other.Name Then
                    Return -1
                Else
                    Return 1
                End If
            Else
                If Me.BoundPane <> "" Then
                    Return 1
                ElseIf other.BoundPane <> "" Then
                    Return -1
                End If
            End If
        End Function

        Public Function CompareTo1(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
            Return CompareTo(obj)
        End Function
    End Class
End Namespace